#ifndef __CHRISTMAS_TREE_BLOCK_H__
#define __CHRISTMAS_TREE_BLOCK_H__

#include "Block.hpp"

namespace PocketSurvival
{
    // 圣诞树 未完成... 没有对接电路
    class ChristmasTreeBlock : public Block
    {
    public:
    	static constexpr int32_t Index()
        {
            return 63;
        }
        virtual int32_t getIndex() override; 
        virtual const std::string &getBlockName() override;
        virtual int32_t getEmittedLightAmount(int32_t value) override;
        

        static inline bool GetLightState(int32_t data);
		static inline int32_t SetLightState(int32_t data, bool state);
    };

    inline bool ChristmasTreeBlock::GetLightState(int32_t data)
	{
		return (data & 1) != 0;
	}

	inline int32_t ChristmasTreeBlock::SetLightState(int32_t data, bool state)
	{
		if (state == false)
		{
			return data & -2;
		}
		return data | 1;
	}

} // namespace PocketSurvival


#endif
